import request from '@/utils/request'

// 获取分区
interface loginData {
  username: string,
  password: string,
  ClientId: string,
  ClientSecret: string,
}

// 登录
export function loginApi (data: loginData) {
  return request({
    url: '/api2/api/v1/Logins/Login',
    method: 'post',
    data: data
  })
}

// 获取全部用户
export function GetAllUserApi (params?:any) {
  return request({
    url: '/api1/api/services/app/User/GetAllUser',
    method: 'get',
    params: params
  })
}

// 新建用户
export function createUserApi (params: any) {
  return request({
    url: '/api1/api/services/app/User/Create',
    method: 'post',
    data: params
  })
}

// 编辑账号
export function updateUserInfoApi (params: any) {
  return request({
    url: '/api1/api/services/app/User/Update',
    method: 'post',
    data: params
  })
}

// 删除账号
export function deleteUserApi (params?: any) {
  return request({
    url: '/api1/api/services/app/User/Delete',
    method: 'post',
    data: params
  })
}

// 重置密码
export function resetPasswordApi (params?: any) {
  return request({
    url: '/api1/api/services/app/User/ResetPassword',
    method: 'post',
    data: params
  })
}
